﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

namespace IdeaSparx.CoolControls.Website
{
    public partial class CoolContent : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack && !IsCallback)
            {
                CoolGridView3.DataSource = GetDummyData();
                CoolGridView3.DataBind();
            }
        }

        private DataTable GetDummyData()
        {
            if (Cache["DummyData"] == null)
            {
                DataTable dt = new DataTable();
                dt.Columns.Add("ID", typeof(int));
                dt.Columns.Add("Name", typeof(string));
                dt.Columns.Add("Tax ID", typeof(string));

                for (int i = 0; i < 95; i++)
                {
                    dt.Rows.Add(i, "Name " + i.ToString(), Guid.NewGuid().ToString());
                }

                Cache["DummyData"] = dt;
            }

            return (DataTable)Cache["DummyData"];
            //return null;
        }
    }
}
